#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace  std;
int main() {
    int n;cin >> n;
    map<int, int>countmap;
    for (int i = 0;i < n;i++) {
        int num;cin >> num;
        countmap[num]++;
    }
    int deletenum = 0;
    for (auto pair : countmap) {
        if (pair.first < pair.second) {
            deletenum += pair.second - pair.first;
        }
        if (pair.first > pair.second) {
            deletenum += pair.second;
        }
    }
    cout << deletenum << endl;
    return 0;
}